package com.wj.core.net;

import com.wj.core.common.client.IClient;
import com.wj.core.common.server.IServer;
import com.wj.core.net.netty.Client.NettyClient;
import com.wj.core.net.netty.server.NettyServer;

/**
 * @author: wangjun
 * @create: 2018-06-01
 *
 * 通信协议
 **/
public enum NetEnum {

  //可拓展
  NETTY(NettyServer.class, NettyClient.class);

  public final Class<? extends IServer> serverClass;
  public final Class<? extends IClient> clientClass;

  NetEnum(final Class<? extends IServer> serverClass,
      final Class<? extends IClient> clientClass) {
    this.serverClass = serverClass;
    this.clientClass = clientClass;
  }

  public static NetEnum getNet(String name) {
    for (NetEnum item : NetEnum.values()) {
      if (item.name().equals(name)) {
        return item;
      }
    }
    return null;
  }
}
